package service;

import dao.AccountTD;
import dao.UserMessageTD;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Account;

@Service
public class ModifyFriend {
    @Autowired
    private  UserMessageTD userMessageTD;
    public boolean addFriend(String my_id,String friend_id){
        if(my_id==null) return false;
        Account account=new Account();
        account.setId(my_id);
        if(!my_id.equals(userMessageTD.havFriend(account,friend_id))){
            if(friend_id==null) return false;
            userMessageTD.insertFriend(my_id,friend_id);
            userMessageTD.insertFriend(friend_id,my_id);
        }
        return true;
    }
    public boolean removeFriend(String my_id,String friend_id){
        return true;
    }
}
